package com.rediscolony.controller;

import com.rediscolony.service.RedisClusterService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RedisClusterController {
	@Resource
	private RedisClusterService redisClusterService;
	@PostMapping("/cluster/{key}")
	public String  setData(@PathVariable String key){
		redisClusterService.set(key,"_ok");
		return "添加成功";
	}
	@GetMapping("/cluster/{key}")
	public String getData(@PathVariable String key){
		return redisClusterService.get(key);
	}
}
